package com.order.app.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.order.app.service.OrderService;
import com.tamll.bean.ProductOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("OrderPage")
    public String OrderPage1(){
        return "admin/orderManagePage";
    }

    @GetMapping("OrderMessage")
    public Page<ProductOrder> OrderMessage1(@RequestParam(defaultValue = "0") Integer pageNumber,@RequestParam(defaultValue = "10") Integer num){
        Page<ProductOrder> productOrderPage = orderService.OrderMessage(pageNumber, num);
        System.out.println(productOrderPage.toString());
        return productOrderPage;
    }
}
